/**   
 * @Title: ConnectUtil.java 
 * @Package cn.edu.cdtu.healthserver.utils
 * @Description: TODO 
 * @author 
 * @date 
 * @version V0.0   
 */
package cn.edu.cdtu.healthclient.utils;

/** 
 * @ClassName: ConnectUtil 
 * @Description: 
 * @author 
 * @date
 *  
 */
public class ConnectUtil {
	
	/**
	 * 
	 * @ClassName: HealthServerContect 
	 * @Description: TODO
	 * @author 
	 * @date 
	 *
	 */
	public static class HealthServerContect {

		//为健康APP的网络连接提供各种参数，例如：网络连接超时设置，服务器ip地址等等。
		public static final long DEFAULT_CONN_MANAGER_TIMEOUT = 20000;
		public static final int DEFAULT_CONNECT_TIMEOUT = 20000;
		public static final int DEFAULT_SOCKET_TIMEOUT = 20000;
		public static final int DEFAULT_HOST_CONNECTIONS = 200;
		public static final int DEFAULT_MAX_CONNECTIONS = 500;
		public static final boolean STALE_CHECKING_ENABLED = true;
		public static final String DEFAULT_AGENT = 
				"Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-CN; rv:1.9.2) "
				+ "Gecko/20100115 Firefox/3.6";
		//默认套接字缓存大小。
		public static final int DEFAULT_SOCKET_BUFFER_SIZE = 1024 * 1024;
		//与服务器连接的协议为HTTP。
		private static final String PROTOCOL = "http://";
		                     //192.168.56.1
		                     //10.15.76.36
		                     //192.168.191.1
		//服务器IP地址。
		private static final String HOST = "119.4.46.12";
		//连接到服务器的端口。
		private static final String PORT = ":8080";
		private static final String WEB_NAME = "/HealthServer";
		
		//URL格式 协议+服务器IP地址+服务器的端口号+访问的服务器上的内容提供页。
		public static final String SERVER_URL = PROTOCOL  + HOST + PORT + WEB_NAME;
		public static final String TEST_TYPE_SERVLET = "/TestTypeServletForClient";
		//健康新闻Servlet，APP访问服务器上的该Servlet获得健康新闻的内容。
		public static final String HEALTH_NEWS_SERVLET = "/HealthNewsServlet";
		//获取服务器上的登录信息。
		public static final String LOGIN_SERVLET = "/LoginServlet";
		public static final String TEST_SERVLET = "/TestServletForClient";
		//
		public static final String QUESTION_SERVLET = "/QuestionServletForClient";
		public static final String TEST_LOG_SERVLET = "/TestLogServletForClient";
		public static final String DOCTOR_SERVLET = "/OutputDoctor";
		//获取服务器上的注册信息。
		public static final String REGISTER_SERVLET = "/RegisterServlet";
		//获取服务器上的健康文件信息。
		public static final String HEALTH_FILE_SERVLET = "/HealthFileServlet";
		//从互联网上获取资讯信息。
		public static final String GET_NEWS_FROM_INTERNET_SERVLET = "/GetNewsFromInternetServlet";
		public static final String NEWS_XML = "/news.xml";
	}
	/**
	 * 
	 * @ClassName: ContentTypeString 
	 * @Description: TODO
	 * @author 
	 * @date 
	 *
	 */
	public static class ContentTypeString{
		public static final String jSON_STRING = "text/json;charset=utf-8";
	}
	/**
	 * 
	 * @ClassName: HealthTestPargrams 
	 * @Description: TODO
	 * @author 
	 * @date 
	 *
	 */
	public static class HealthTestPargrams{
		/*
		 * 
		 */
		public static class Option{
			public static final String HEALTH_TEST_OPTION = "health_test_option";
			/*
			 * 
			 */
			public static class OptionValue{
				public static final String HEALTH_TEST_OPTION_GET_TEST_TYPE =
						"get_test_type";
				public static final String HEALTH_TEST_OPTION_GET_TEST =
						"get_test";
				public static final String HEALTH_TEST_OPTION_GET_QUESTION_SET =
						"get_question_set";
				public static final String HEALTH_TEST_OPTION_SUBMIT_ANSWER =
						"submit_answer";
				public static final String HEALTH_TEST_OPTION_GET_TEST_LOG = 
						"get_test_log";
				public static final String HEALTH_TEST_OPTION_GET_QUESTION_LOG =
						"get_question_log";
			}
		}
		/*
		 * 
		 */
		public static class Pargram{
			public static final String SELECT_TEST_TYPE = "select_test_type";
			public static final String SELECT_TEST = "select_test";
			public static final String QUESTION_ANSWER = "question_answer";
			public static final String SELECT_TEST_LOG = "select_test_log";
		}
		/*
		 * 
		 */
		public static class Result{
			public static final String NO_DATA = "no_data";
			public static final String SUBMIT_SUCCESS = "submit_success";
			public static final String SUBMIT_FAIL = "submit_fail";
			public static final String NO_LOGIN_USER = "no_login_user";
		}
	}
	/**
	 * 
	 * @ClassName: HealthNewsPargrams 
	 * @Description: TODO
	 * @author 
	 * @date 
	 *
	 */
	public static class HealthNewsPargrams{
		/*
		 * 
		 */
		public static class Option{
			
			public static final String HEALTH_NEWS_OPERATION = "operation";
			/*
			 * 
			 */
			public static class OptionValue{
				public static final String HEALTH_NEWS_OPERATION_BODY = "body";
				public static final String hEALTH_NEWS_OPERATION_MENTAL = "mental";
			}
		}
		/*
		 * 
		 */
		public static class Pargram{
			public static final String HEALTH_NEWS_ID = "id";
		}
	}
	/**
	 * 
	 * @ClassName: HealthFilePargrams 
	 * @Description: TODO
	 * @author 
	 * @date 
	 *
	 */
	public static final class HealthFilePargrams{
		/*
		 * 
		 */
		public static final class Option{
			
			/*
			 * 
			 */
			public static final class OptionValue{

			}
		}
		/*
		 * 
		 */
		public static final class Pargram{
			public static final String HEALTH_FILE_TYPE_ID = "type_id";
		}
	}
	/**
	 * 
	 * @ClassName: LoginPargrams 
	 * @Description: 该类只提供登录时需要的常量标签。
	 * @author 
	 * @date 
	 *
	 */
	public static class LoginPargrams{
		/*
		 * 
		 */
		public static class Option{

			/*
			 * 
			 */
			public static class OptionValue{

			}
		}
		/*
		 * 
		 */
		public static class Pargram{
			public static final String LOGIN_ACCOUNT = "account";
			public static final String LOGIN_PASSWORD = "password";
		}
	}
	/**
	 * 
	 * @ClassName: RegisterPargrams 
	 * @Description: 该类只提供注册时需要的常量标签。
	 * @author 
	 * @date 
	 *
	 */
	public static final class RegisterPargrams{
		/*
		 * 
		 */
		public static final class Option{

			/*
			 * 
			 */
			public static final class OptionValue{

			}
		}
		/*
		 * 
		 */
		public static final class Pargram{
			public static final String REGISTER_ACCOUNT = "accountRegister";
			public static final String REGISTER_PASSWORD = "passwordRegister";
			public static final String REGISTER_NAME = "userNameRegister";
		}
	}
	/**
	 * 
	 * @ClassName: HealthDoctorRegister 
	 * @Description: TODO
	 * @author 
	 * @date 
	 *
	 */
	public static final class HealthDoctorRegister{
		/*
		 * 
		 */
		public static final class Option{
			public static final String DO_WHAT = "doWhat";
			/*
			 * 
			 */
			public static final class OptionValue{
				public static final String GET_DOCTOR_LIST = "getDoctorList";
				public static final String SEND_REG = "sendReg";
			}
		}
		/*
		 * 
		 */
		public static final class Pargram{
			public static final String REG_GET = "regGet";
		}
		/*
		 * 
		 */
		public static final class Result{
			public static final String REG_SUCCESS = "reg_success";
			public static final String REG_FALI = "reg_fail";
		}
	}
}
